home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Icons.h
-
- Contains: Icon Utilities Interfaces.
-
- Version: Technology: System 7.5
- Package: Universal Interfaces 2.0 in “MPW Latest” on ETO #17
-
- Copyright: © 1984-1995 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
-
- #ifndef __ICONS__
- #define __ICONS__
-
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- /* #include <ConditionalMacros.h> */
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
- /* #include <MixedMode.h> */
- /* #include <QuickdrawText.h> */
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
-
- enum {
- /* The following are icons for which there are both icon suites and SICNs. */
- genericDocumentIconResource = -4000,
- genericStationeryIconResource = -3985,
- genericEditionFileIconResource = -3989,
- genericApplicationIconResource = -3996,
- genericDeskAccessoryIconResource = -3991,
- genericFolderIconResource = -3999,
- privateFolderIconResource = -3994,
- floppyIconResource = -3998,
- trashIconResource = -3993,
- /* The following are icons for which there are SICNs only. */
- desktopIconResource = -3992,
- openFolderIconResource = -3997,
- genericHardDiskIconResource = -3995,
- genericFileServerIconResource = -3972,
- genericSuitcaseIconResource = -3970,
- genericMoverObjectIconResource = -3969,
- /* The following are icons for which there are icon suites only. */
- genericPreferencesIconResource = -3971,
- genericQueryDocumentIconResource = -16506,
- genericExtensionIconResource = -16415,
- systemFolderIconResource = -3983,
- appleMenuFolderIconResource = -3982
- };
-
- enum {
- startupFolderIconResource = -3981,
- ownedFolderIconResource = -3980,
- dropFolderIconResource = -3979,
- sharedFolderIconResource = -3978,
- mountedFolderIconResource = -3977,
- controlPanelFolderIconResource = -3976,
- printMonitorFolderIconResource = -3975,
- preferencesFolderIconResource = -3974,
- extensionsFolderIconResource = -3973,
- fontsFolderIconResource = -3968,
- fullTrashIconResource = -3984,
- large1BitMask = 'ICN#',
- large4BitData = 'icl4',
- large8BitData = 'icl8',
- small1BitMask = 'ics#',
- small4BitData = 'ics4',
- small8BitData = 'ics8',
- mini1BitMask = 'icm#',
- mini4BitData = 'icm4',
- mini8BitData = 'icm8'
- };
-
- /* alignment type values */
- enum {
- atNone = 0x0,
- atVerticalCenter = 0x1,
- atTop = 0x2,
- atBottom = 0x3,
- atHorizontalCenter = 0x4,
- atAbsoluteCenter = atVerticalCenter | atHorizontalCenter,
- atCenterTop = atTop | atHorizontalCenter,
- atCenterBottom = atBottom | atHorizontalCenter,
- atLeft = 0x8,
- atCenterLeft = atVerticalCenter | atLeft,
- atTopLeft = atTop | atLeft,
- atBottomLeft = atBottom | atLeft,
- atRight = 0xC,
- atCenterRight = atVerticalCenter | atRight,
- atTopRight = atTop | atRight,
- atBottomRight = atBottom | atRight
- };
-
- typedef short IconAlignmentType;
-
- /* transform type values */
-
- enum {
- ttNone = 0x0,
- ttDisabled = 0x1,
- ttOffline = 0x2,
- ttOpen = 0x3,
- ttLabel1 = 0x0100,
- ttLabel2 = 0x0200,
- ttLabel3 = 0x0300,
- ttLabel4 = 0x0400,
- ttLabel5 = 0x0500,
- ttLabel6 = 0x0600,
- ttLabel7 = 0x0700,
- ttSelected = 0x4000,
- ttSelectedDisabled = ttSelected | ttDisabled,
- ttSelectedOffline = ttSelected | ttOffline,
- ttSelectedOpen = ttSelected | ttOpen
- };
-
- typedef short IconTransformType;
-
- /* Selector mask values */
-
- enum {
- svLarge1Bit = 0x00000001,
- svLarge4Bit = 0x00000002,
- svLarge8Bit = 0x00000004,
- svSmall1Bit = 0x00000100,
- svSmall4Bit = 0x00000200,
- svSmall8Bit = 0x00000400,
- svMini1Bit = 0x00010000,
- svMini4Bit = 0x00020000,
- svMini8Bit = 0x00040000,
- svAllLargeData = 0x000000ff,
- svAllSmallData = 0x0000ff00,
- svAllMiniData = 0x00ff0000,
- svAll1BitData = svLarge1Bit | svSmall1Bit | svMini1Bit,
- svAll4BitData = svLarge4Bit | svSmall4Bit | svMini4Bit,
- svAll8BitData = svLarge8Bit | svSmall8Bit | svMini8Bit,
- svAllAvailableData = 0xffffffffL
- };
-
- typedef unsigned long IconSelectorValue;
-
- typedef pascal OSErr (*IconActionProcPtr)(ResType theType, Handle *theIcon, void *yourDataPtr);
-
- #if GENERATINGCFM
- typedef UniversalProcPtr IconActionUPP;
- #else
- typedef IconActionProcPtr IconActionUPP;
- #endif
-
- enum {
- uppIconActionProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ResType)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(Handle*)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void*)))
- };
-
- #if GENERATINGCFM
- #define NewIconActionProc(userRoutine) \
- (IconActionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppIconActionProcInfo, GetCurrentArchitecture())
- #else
- #define NewIconActionProc(userRoutine) \
- ((IconActionUPP) (userRoutine))
- #endif
-
- #if GENERATINGCFM
- #define CallIconActionProc(userRoutine, theType, theIcon, yourDataPtr) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppIconActionProcInfo, (theType), (theIcon), (yourDataPtr))
- #else
- #define CallIconActionProc(userRoutine, theType, theIcon, yourDataPtr) \
- (*(userRoutine))((theType), (theIcon), (yourDataPtr))
- #endif
-
- typedef IconActionProcPtr IconAction;
-
- typedef pascal Handle (*IconGetterProcPtr)(ResType theType, void *yourDataPtr);
-
- #if GENERATINGCFM
- typedef UniversalProcPtr IconGetterUPP;
- #else
- typedef IconGetterProcPtr IconGetterUPP;
- #endif
-
- enum {
- uppIconGetterProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(Handle)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ResType)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void*)))
- };
-
- #if GENERATINGCFM
- #define NewIconGetterProc(userRoutine) \
- (IconGetterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppIconGetterProcInfo, GetCurrentArchitecture())
- #else
- #define NewIconGetterProc(userRoutine) \
- ((IconGetterUPP) (userRoutine))
- #endif
-
- #if GENERATINGCFM
- #define CallIconGetterProc(userRoutine, theType, yourDataPtr) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppIconGetterProcInfo, (theType), (yourDataPtr))
- #else
- #define CallIconGetterProc(userRoutine, theType, yourDataPtr) \
- (*(userRoutine))((theType), (yourDataPtr))
- #endif
-
- typedef IconGetterProcPtr IconGetter;
-
- #if !OLDROUTINELOCATIONS
- struct CIcon {
- PixMap iconPMap; /*the icon's pixMap*/
- BitMap iconMask; /*the icon's mask*/
- BitMap iconBMap; /*the icon's bitMap*/
- Handle iconData; /*the icon's data*/
- short iconMaskData[1]; /*icon's mask and BitMap data*/
- };
- typedef struct CIcon CIcon, *CIconPtr, **CIconHandle;
-
- extern pascal CIconHandle GetCIcon(short iconID)
- ONEWORDINLINE(0xAA1E);
- extern pascal void PlotCIcon(const Rect *theRect, CIconHandle theIcon)
- ONEWORDINLINE(0xAA1F);
- extern pascal void DisposeCIcon(CIconHandle theIcon)
- ONEWORDINLINE(0xAA25);
- extern pascal Handle GetIcon(short iconID)
- ONEWORDINLINE(0xA9BB);
- extern pascal void PlotIcon(const Rect *theRect, Handle theIcon)
- ONEWORDINLINE(0xA94B);
- #endif
- extern pascal OSErr PlotIconID(const Rect *theRect, IconAlignmentType align, IconTransformType transform, short theResID)
- THREEWORDINLINE(0x303C, 0x0500, 0xABC9);
- extern pascal OSErr NewIconSuite(Handle *theIconSuite)
- THREEWORDINLINE(0x303C, 0x0207, 0xABC9);
- extern pascal OSErr AddIconToSuite(Handle theIconData, Handle theSuite, ResType theType)
- THREEWORDINLINE(0x303C, 0x0608, 0xABC9);
- extern pascal OSErr GetIconFromSuite(Handle *theIconData, Handle theSuite, ResType theType)
- THREEWORDINLINE(0x303C, 0x0609, 0xABC9);
- extern pascal OSErr ForEachIconDo(Handle theSuite, IconSelectorValue selector, IconActionUPP action, void *yourDataPtr)
- THREEWORDINLINE(0x303C, 0x080A, 0xABC9);
- extern pascal OSErr GetIconSuite(Handle *theIconSuite, short theResID, IconSelectorValue selector)
- THREEWORDINLINE(0x303C, 0x0501, 0xABC9);
- extern pascal OSErr DisposeIconSuite(Handle theIconSuite, Boolean disposeData)
- THREEWORDINLINE(0x303C, 0x0302, 0xABC9);
- extern pascal OSErr PlotIconSuite(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIconSuite)
- THREEWORDINLINE(0x303C, 0x0603, 0xABC9);
- extern pascal OSErr MakeIconCache(Handle *theHandle, IconGetterUPP makeIcon, void *yourDataPtr)
- THREEWORDINLINE(0x303C, 0x0604, 0xABC9);
- extern pascal OSErr LoadIconCache(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIconCache)
- THREEWORDINLINE(0x303C, 0x0606, 0xABC9);
- extern pascal OSErr PlotIconMethod(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconGetterUPP theMethod, void *yourDataPtr)
- THREEWORDINLINE(0x303C, 0x0805, 0xABC9);
- extern pascal OSErr GetLabel(short labelNumber, RGBColor *labelColor, Str255 labelString)
- THREEWORDINLINE(0x303C, 0x050B, 0xABC9);
- extern pascal Boolean PtInIconID(Point testPt, const Rect *iconRect, IconAlignmentType align, short iconID)
- THREEWORDINLINE(0x303C, 0x060D, 0xABC9);
- extern pascal Boolean PtInIconSuite(Point testPt, const Rect *iconRect, IconAlignmentType align, Handle theIconSuite)
- THREEWORDINLINE(0x303C, 0x070E, 0xABC9);
- extern pascal Boolean PtInIconMethod(Point testPt, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
- THREEWORDINLINE(0x303C, 0x090F, 0xABC9);
- extern pascal Boolean RectInIconID(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, short iconID)
- THREEWORDINLINE(0x303C, 0x0610, 0xABC9);
- extern pascal Boolean RectInIconSuite(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, Handle theIconSuite)
- THREEWORDINLINE(0x303C, 0x0711, 0xABC9);
- extern pascal Boolean RectInIconMethod(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
- THREEWORDINLINE(0x303C, 0x0912, 0xABC9);
- extern pascal OSErr IconIDToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, short iconID)
- THREEWORDINLINE(0x303C, 0x0613, 0xABC9);
- extern pascal OSErr IconSuiteToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, Handle theIconSuite)
- THREEWORDINLINE(0x303C, 0x0714, 0xABC9);
- extern pascal OSErr IconMethodToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
- THREEWORDINLINE(0x303C, 0x0915, 0xABC9);
- extern pascal OSErr SetSuiteLabel(Handle theSuite, short theLabel)
- THREEWORDINLINE(0x303C, 0x0316, 0xABC9);
- extern pascal short GetSuiteLabel(Handle theSuite)
- THREEWORDINLINE(0x303C, 0x0217, 0xABC9);
- extern pascal OSErr GetIconCacheData(Handle theCache, void **theData)
- THREEWORDINLINE(0x303C, 0x0419, 0xABC9);
- extern pascal OSErr SetIconCacheData(Handle theCache, void *theData)
- THREEWORDINLINE(0x303C, 0x041A, 0xABC9);
- extern pascal OSErr GetIconCacheProc(Handle theCache, IconGetterUPP *theProc)
- THREEWORDINLINE(0x303C, 0x041B, 0xABC9);
- extern pascal OSErr SetIconCacheProc(Handle theCache, IconGetterUPP theProc)
- THREEWORDINLINE(0x303C, 0x041C, 0xABC9);
- extern pascal OSErr PlotIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIcon)
- THREEWORDINLINE(0x303C, 0x061D, 0xABC9);
- extern pascal OSErr PlotSICNHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theSICN)
- THREEWORDINLINE(0x303C, 0x061E, 0xABC9);
- extern pascal OSErr PlotCIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, CIconHandle theCIcon)
- THREEWORDINLINE(0x303C, 0x061F, 0xABC9);
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __ICONS__ */
-